﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DBServerInfo_Edit.aspx.vb"
    Inherits="Map.DBServerInfo_Edit" %>

<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/_common/styles/global.css" />
    <link rel="stylesheet" type="text/css" href="/_common/styles/select.css" />
    <link rel="stylesheet" type="text/css" href="/_nav/menu.css" />
    <link rel="stylesheet" type="text/css" href="/_nav/tabs.css" />
    <link rel="stylesheet" type="text/css" href="/_nav/nav.css" />
    <link rel="stylesheet" type="text/css" href="/_grid/map_grid.css" />
    <link rel="stylesheet" type="text/css" href="/_forms/styles/Form.css" />

    <script src="/_common/scripts/global.js" type="text/javascript"></script>

    <script src="/_common/scripts/Details.js" type="text/javascript"></script>

    <script src="/_controls/settings.aspx" type="text/javascript"></script>

    <script src="/_controls/util/util.js" type="text/javascript"></script>

    <script src="/_controls/datetime/date.js" type="text/javascript"></script>

    <script src="/_controls/datetime/time.js" type="text/javascript"></script>

    <script src="/_controls/number/number.js" type="text/javascript"></script>

    <script src="/_controls/lookup/map_lookup.js" type="text/javascript"></script>

    <script src="/_controls/find/find.js" type="text/javascript"></script>

    <script src="/_nav/menu.js" type="text/javascript"></script>

    <script src="/_forms/FormBase.js" type="text/javascript"></script>

    <script src="../Js/LMSCommon.js" type="text/javascript"></script>

    <script type="text/javascript">

        //页面初始化
        function window_onload()
        {
            HideMenu();
            appForm._bAlert = false;
//            if (appForm.CpuQuantity.value == "")
//            {
//                appForm.CpuQuantity.setValue("1");
//            }
        }
        function oprAfterSave()
        {
            // 处理返回结果
            try
            {
                var xmlDom = XMLDOM();

                xmlDom.loadXML(appForm.returnxml);
                if (xmlDom.parseError.errorCode == 0)
                {
                    if (xmlDom.documentElement.attributes.getNamedItem("result").text == "true")		// 返回成功
                    {
                        document.getElementById("DBFileInfo").src = "DBServerInfo_DBFileInfo.aspx";
                        alert("保存成功！");                        
                    }
                    else
                    {
                        alert("保存失败：" + xmlDom.documentElement.attributes.getNamedItem("errormessage").text);
                    }
                }
                else
                {
                    alert('保存失败!');
                }
            }
            catch (e)
            {
            }
            finally
            {
                // 删除对象
                delete (oHTTP);
                delete (xmlDom);
            }

        }

        //刷新
        function Refresh()
        {
            openWaiting();
            window.setTimeout(InnerRefresh, 0);
        }

        //刷新
        function InnerRefresh()
        {
            var oHTTP = new ActiveXObject("Msxml2.XMLHTTP");
            var sUrl = "/ApplicationMap.aspx?functionid=00000303&actionid=02";
            oHTTP.open("POST", sUrl, false);
            oHTTP.send("<dataxml mysessionstate=\"" + document.all["___MYSESSIONSTATE"].value + "\"><userdataxml></userdataxml></dataxml>");

            // 要求返回xml格式<xml result="true/flase" errormessage="错误信息！">任意正确格式的xml</xml>。
            var xmlReturn = oHTTP.responseText;
            delete (oHTTP);

            if (xmlReturn != "")
            {
                var xmlDom = XMLDOM();
                xmlDom.loadXML(xmlReturn);

                if (xmlDom.parseError.errorCode == 0)
                {
                    var dbVersionNode = xmlDom.documentElement.selectSingleNode("/DBServerInfo/DbVersion")
                    if (dbVersionNode)
                    {
                        appForm.DbVersion.setValue(dbVersionNode.text);
                    }

                    var dbNameNode = xmlDom.documentElement.selectSingleNode("/DBServerInfo/DbName")
                    if (dbNameNode)
                    {
                        appForm.DbName.setValue(dbNameNode.text);
                    }

                    var dbIDNode = xmlDom.documentElement.selectSingleNode("/DBServerInfo/DbID")
                    if (dbIDNode)
                    {
                        appForm.DbID.setValue(dbIDNode.text);
                    }

                    var dbFileSizeNode = xmlDom.documentElement.selectSingleNode("/DBServerInfo/DbFileSize")
                    if (dbFileSizeNode)
                    {
                        appForm.DbFileSize.setValue(dbFileSizeNode.text);
                    }

                    var indexChipNode = xmlDom.documentElement.selectSingleNode("/DBServerInfo/IndexChip")
                    if (indexChipNode)
                    {
                        appForm.IndexChip.setValue(indexChipNode.text);
                    }
                    document.getElementById("DBFileInfo").src = "DBServerInfo_DBFileInfo.aspx?xml=/LMS/ConfigManage/DBServerInfo_TempDBFileInfo.xml"
                }
                else
                {
                    alert('刷新失败!');
                }
            }

            closeWaiting();
        }
    </script>

</head>
<body ms_positioning="GridLayout" style="padding: 10px;" onload="window_onload()">
    <table style="font-size: 9pt;" height="100%" cellspacing="0" cellpadding="0" width="100%">
        <tr height="1">
            <td>
                <mnu:AppFormMenu ID="appFormMenu" runat="server" />
            </td>
        </tr>
        <tr>
            <td style="height: 5px">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <cnt:AppForm ID="appForm" runat="server" ProcessType="xmlhttp" OnAfterSave="oprAfterSave()">
                </cnt:AppForm>
            </td>
        </tr>
    </table>
</body>
</html>
